﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Shared
{
    [DataContract]
    public class Activate
    {
        [DataMember]
        public DateTime TimeStamp { get; set; }

        [DataMember]
        public ActivateState State { get; set; }

        [DataMember]
        public string Identity { get; set; }

        [DataMember]
        public int OrderId { get; set; }

        [DataMember]
        public int OrderStateId { get; set; }

        public string ToCSV()
        {
            string seperator = ",";
            string result = String.Empty;

            result +=
                TimeStamp.ToString() + seperator +
                State.ToString() + seperator +
                Identity.ToString() + seperator +
                OrderId.ToString() + seperator + 
                OrderStateId.ToString();

            return result;
        }

        public string PrintHeader()
        {
            string result = String.Empty;
            result +=
                "Timestamp," +
                "State," +
                "Identity," +
                "OrderId" + 
                "OrderStateId" +
                Environment.NewLine;
                
            return result;
        }

        public override string ToString()
        {
            string result = String.Empty;

            result +=
                "Timestamp: " + TimeStamp.ToString() + Environment.NewLine +
                "State: " + State.ToString() + Environment.NewLine +
                "Identity: " + Identity.ToString() + Environment.NewLine +
                "OrderId: " + OrderId.ToString() + Environment.NewLine +
                "OrderStateId: " + OrderStateId.ToString() + Environment.NewLine;
            
            return result;
        } 
    }
}
